﻿using Client.Todo.Common;
using Client.Todo.Views;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client.Todo.Extendsions
{
    public static class DilogHostExtensions
    {
        /// <summary>
        /// 询问窗口
        /// </summary>
        /// <param name="dialogHost">指定DialogHost会话主机</param>
        /// <param name="title">标题</param>
        /// <param name="content">内容</param>
        /// <param name="dialogHostName">会话主机名，唯一</param>
        /// <returns></returns>
        public static async Task<IDialogResult> Question(
            this IDialogHostService dialogHost,
            string title = "温馨提示",
            string content = "确定要继续操作吗？",
            string dialogHostName = "RootDialog")
        {
            DialogParameters dialogParameters = new DialogParameters();
            dialogParameters.Add("Title", title);
            dialogParameters.Add("Content", content);
            dialogParameters.Add("dialogHostName", dialogHostName);
            return await dialogHost.ShowDialog(nameof(MessageView), dialogParameters, dialogHostName);
        }
    }
}
